package com.entity.customer;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.sql.Timestamp;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("customer_contacts") // 映射到数据库表名
@ApiModel("客户联系人实体")
public class CustomerContacts {

    @ApiModelProperty(value = "联系人ID，主键，唯一标识每个联系人")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "所属客户公司ID，外键关联到客户公司表")
    @TableField("customer_company_id")
    private Long customerCompanyId;

    @ApiModelProperty(value = "联系人姓名，不能为空", required = true)
    @TableField("full_name")
    private String fullName;

    @ApiModelProperty(value = "职位，可选字段")
    @TableField("position")
    private String position;

    @ApiModelProperty(value = "联系电话，可选字段")
    @TableField("phone_number")
    private String phoneNumber;

    @ApiModelProperty(value = "邮箱地址，可选字段")
    @TableField("email")
    private String email;

    @ApiModelProperty(value = "历史手机号")
    @TableField("history_phone")
    private String historyPhone;

    @ApiModelProperty(value = "是否为主要联系人，默认为否")
    @TableField("is_primary")
    private Integer isPrimary;

    @ApiModelProperty(value = "是否删除，0-是，1-否")
    @TableField(value = "is_delete")
    private Integer isDelete;

    @ApiModelProperty(value = "记录创建时间，默认为当前时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "记录更新时间，每次更新时自动刷新")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
